﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PM.Web
{
    public partial class NewsDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bindData();
            }
        }
        private void bindData()
        {
            int id = 0;
            if (!int.TryParse(Request.QueryString["id"].Trim(), out id))
            {
                this.litTitle.Text = "非法访问！参数错误！";
                return;
            }
            DataAccess.PmData dal = new DataAccess.PmData();
            System.Data.DataTable dt = dal.GetWebSiteNewsList(1, null, id, null);
            if (dt.Rows.Count > 0)
            {
                this.litTitle.Text = dt.Rows[0]["Title"].ToString();
                this.litContent.Text = dt.Rows[0]["Content"].ToString();
            }
        }
    }
}